package top.fkxuexi.blogapi.core.utils.common;

import lombok.Getter;
import lombok.Setter;

/**
 * 无论返回的结果是简单还是复杂，必须一定要统一的返回消息实体Result
 */
public class Result {

    /**
     * 请求状态码，参见 {@link Code}
     */
    @Setter@Getter private Integer code;
    @Setter@Getter private Object data;
    @Setter@Getter private boolean state;
    /**
     *建议全部采用，状态吗，不采用返回消息的方式
     */
    @Setter@Getter private String msg;
    /**
     * 如果需要跳转的时候，可以附带连接
     */
    @Setter@Getter private String url;


    public Result(Integer code,boolean state,Object data){
        this.code = code;
        this.state = state;
        this.data = data;
    }

    public Result(Integer code,boolean state){
        this.code = code;
        this.state = state;
    }

    public Result(Integer code,boolean state,String msg){
        this.code = code;
        this.state = state;
        this.msg = msg;
    }


}
